if (!rec.isValid()) {
if (_propagator && _item) {
qCWarning(lcEncryptFolderJob) << "No valid record found in local DB for fileId" << fileId << "going to create it now...";
+ _item->_e2eEncryptionStatus = EncryptionStatusEnums::ItemEncryptionStatus::EncryptedMigratedV2_0;
+ _item->_e2eCertificateFingerprint = _account->e2e()->certificateSha256Fingerprint();
const auto updateResult = _propagator->updateMetadata(*_item.data());
if (updateResult) {
[[maybe_unused]] const auto result = _journal->getFileRecord(currentPath, &rec);
}
}
- if (!rec.isE2eEncrypted()) {
+ if (rec.isValid() && !rec.isE2eEncrypted()) {
rec._e2eEncryptionStatus = SyncJournalFileRecord::EncryptionStatus::Encrypted;
rec._e2eCertificateFingerprint = _account->e2e()->certificateSha256Fingerprint();
const auto result = _journal->setFileRecord(rec);
{
qCDebug(lcPropagateUpload) << "Starting to upload encrypted file" << path << filename << size;
_uploadingEncrypted = true;
+ _item->_e2eEncryptionStatus = EncryptionStatusEnums::ItemEncryptionStatus::EncryptedMigratedV2_0;
+ Q_ASSERT(_item->isEncrypted());
_fileToUpload._path = path;
_fileToUpload._file = filename;
_fileToUpload._size = size;
void PropagateUploadFileCommon::slotOnErrorStartFolderUnlock(SyncFileItem::Status status, const QString &errorString)
{
if (_uploadingEncrypted) {
+ Q_ASSERT(_item->isEncrypted());
+
_uploadStatus = { status, errorString };
connect(_uploadEncryptedHelper, &PropagateUploadEncrypted::folderUnlocked, this, &PropagateUploadFileCommon::slotFolderUnlocked);
_uploadEncryptedHelper->unlockFolder();
propagator()->_journal->commit("upload file start");
if (_uploadingEncrypted) {
+ Q_ASSERT(_item->isEncrypted());
+
_uploadStatus = { SyncFileItem::Success, QString() };
connect(_uploadEncryptedHelper, &PropagateUploadEncrypted::folderUnlocked, this, &PropagateUploadFileCommon::slotFolderUnlocked);
_uploadEncryptedHelper->unlockFolder();